/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Server.ImplementInterface;

import Interface.IRemoteMonthlyReportDetail;
import Server.DTO.MonthlyReportDetail_DTO;
import java.rmi.RemoteException;
import static java.rmi.server.RemoteServer.getClientHost;
import java.rmi.server.ServerNotActiveException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;

/**
 *
 * @author 10520_000
 */
public class MonthlyReportDetailObject extends UnicastRemoteObject implements IRemoteMonthlyReportDetail{
    public MonthlyReportDetailObject() throws RemoteException{
        super();
    }
    @Override
    public int Insert(MonthlyReportDetail_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Insert from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return MonthlyReportDetailRepository.Insert(info);
    }

    @Override
    public int Update(MonthlyReportDetail_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Update from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return MonthlyReportDetailRepository.Update(info);
    }

    @Override
    public int Delete(MonthlyReportDetail_DTO info) throws RemoteException {
        try {
            System.out.println("Invoke Delete from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return MonthlyReportDetailRepository.Delete(info);
    }

    @Override
    public ArrayList FindAll() throws RemoteException {
        try {
            System.out.println("Invoke FindAll from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return MonthlyReportDetailRepository.FindAll();
    }

    @Override
    public ArrayList FindbyDetailID(String DetailID) throws RemoteException {
        try {
            System.out.println("Invoke Find by DetailID from " + getClientHost());
        } catch (ServerNotActiveException snae) {
            snae.printStackTrace();
        }
        return MonthlyReportDetailRepository.FindByDetailID(DetailID);
    }
    
}
